﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ClienteDetalhe.aspx.cs" Inherits="welwitschia.Clientes.ClienteDetalhe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
            
            $(function () {
                $("#tabs").tabs();
            });

    
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <div class="formulario">
            <div id="header" class="info">
                <h2>
                    Informação de Cliente</h2>
            </div>
            <ul class="formularioConteudo">
                <li>
                    <label class="desc" id="lblCliente">
                    Cliente <span id="req_3" class="req">*</span>
                </label>
                <span>
                    <asp:TextBox ID="txtNome" CssClass="required text ln" MaxLength="255" size="40" runat="server"></asp:TextBox>
                    <label for="Field4">
                        Nome</label>
                </span>
                  <span>
                    <asp:TextBox ID="txtIdCliente" CssClass="field text fn" size="4" runat="server"></asp:TextBox>
                    <label for="Field3">
                        Código</label>
                </span>
              </li>
        </ul>
    </div>
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">Unidades</a></li>
            <li><a href="#tabs-2">Refeitórios</a></li>
            <li><a href="#tabs-3">Contratos</a></li>
        </ul>
        <div id="tabs-1">
            <asp:ListView runat="server" ID="lvUnidades" DataKeyNames="IdUnidade" OnItemDeleting="lvUnidades_ItemDeleting"
                OnItemEditing="lvUnidades_ItemEditing" OnItemCommand="lvUnidades_ItemCommand">
                <LayoutTemplate>
                    <table runat="server" class="grd" id="table1">
                        <thead>
                            <tr class="ghdr">
                                <td>
                                    <asp:Label ID="Label2" runat="server">Id</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label3" runat="server">Designação</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label4" runat="server">Serviço</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label5" runat="server">&nbsp;</asp:Label>
                                </td>
                            </tr>
                        </thead>
                <tr runat="server" id="itemPlaceholder">
                </tr>
            </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="Tr1" class='grd<%#Container.DataItemIndex % 2 %>' >
                        <td id="Td1" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="lblUnidade" runat="server" Text='<%#Eval("IdUnidade") %>' />
                        </td>
                        <td id="Td2" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="lblDesignacao" runat="server" Text='<%#Eval("Designacao") %>' />
                        </td>
                        <td id="Td4" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:CheckBox ID="chkServico" runat="server" Enabled="false" Checked='<%#Eval("Servico") %>' />
                        </td>
                        <td id="Td3" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:LinkButton ID="EditButton" CommandName="Edit" CommandArgument='<%# Eval("IdUnidade")%>'
                                runat="server" Text="Editar"></asp:LinkButton>
                            <asp:LinkButton ID="DeleteButton" OnClientClick="return confirm('Apaga registo?');"
                                CommandName="Delete" CommandArgument='<%# Eval("IdUnidade")%>' runat="server"
                                Text="Apagar"></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
            <div style="margin:10px 5px 0px 10px" > 
            <asp:Button ID="btnCriarUnidade" runat="server" Text="Criar Unidade" 
        onclick="btnCriarUnidade_Click" />
        </div>
        </div>
        <div id="tabs-2">
              <asp:ListView runat="server" ID="lvRefeitorios" DataKeyNames="IdUnidade" OnItemDeleting="lvRefeitorios_ItemDeleting"
                OnItemEditing="lvRefeitorios_ItemEditing" OnItemCommand="lvRefeitorios_ItemCommand">
                <LayoutTemplate>
                     <table runat="server" class="grd" id="table2">
                        <thead>
                            <tr class="ghdr">
                                <td>
                                    <asp:Label ID="Label2" runat="server">Id</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label3" runat="server">Designação</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label4" runat="server">Serviço</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label5" runat="server">&nbsp;</asp:Label>
                                </td>
                            </tr>
                        </thead>
                        <tr runat="server" id="itemPlaceholder">
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="Tr1" class='grd<%#Container.DataItemIndex % 2 %>' >
                        <td id="Td1" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="lblUnidade" runat="server" Text='<%#Eval("IdUnidade") %>' />
                        </td>
                        <td id="Td2" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="lblDesignacao" runat="server" Text='<%#Eval("Designacao") %>' />
                        </td>
                        <td id="Td4" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:CheckBox ID="chkServico"  runat="server" enabled="false" Checked='<%#Eval("Servico") %>' />
                        </td>
                        <td id="Td3" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:LinkButton ID="EditButton" CommandName="Edit" CommandArgument='<%# Eval("IdUnidade")%>'
                                runat="server" Text="Editar"></asp:LinkButton>
                            <asp:LinkButton ID="DeleteButton" OnClientClick="return confirm('Apaga registo?');"
                                CommandName="Delete" CommandArgument='<%# Eval("IdUnidade")%>' runat="server"
                                Text="Apagar"></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </div>
        <div id="tabs-3">
            <asp:ListView runat="server" ID="lvContratos" DataKeyNames="NumeroContrato" OnItemDeleting="lvContratos_ItemDeleting"
                OnItemEditing="lvContratos_ItemEditing" OnItemCommand="lvContratos_ItemCommand">
                <LayoutTemplate>
                     <table runat="server" class="grd" id="table2">
                        <thead>
                            <tr class="ghdr">
                                <td>
                                    <asp:Label ID="Label2" runat="server">Núm.</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label3" runat="server">Data</asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="Label5" runat="server">&nbsp;</asp:Label>
                                </td>
                            </tr>
                        </thead>
                        <tr runat="server" id="itemPlaceholder">
                        </tr>
                    </table>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr id="Tr1" class='grd<%#Container.DataItemIndex % 2 %>' >
                        <td id="Td1" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="Label1" runat="server" Text='<%#Eval("NumeroContrato") %>' />
                        </td>
                        <td id="Td2" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:Label ID="NameLabel" runat="server" Text='<%#Eval("DataContrato") %>' />
                        </td>
                        <td id="Td3" runat="server">
                            <%-- Data-bound content. --%>
                            <asp:LinkButton ID="EditButton" CommandName="Edit" CommandArgument='<%# Eval("NumeroContrato")%>'
                                runat="server" Text="Editar"></asp:LinkButton>
                            <asp:LinkButton ID="DeleteButton" OnClientClick="return confirm('Apaga registo?');"
                                CommandName="Delete" CommandArgument='<%# Eval("NumeroContrato")%>' runat="server"
                                Text="Apagar"></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
            <div style="margin:10px 5px 0px 10px" > 
            <asp:Button ID="btnCriarContrato" runat="server" Text="Criar Contrato" 
        onclick="btnCriarContrato_Click" />
         </div>
        </div>
    </div>
  
     <div class="pageCommandArea" > 
        <asp:Button ID="btnGravar" runat="server" Text="Gravar" OnClick="btnGravar_Click" />
        <asp:Button ID="btnVoltar" runat="server" Text="Voltar" OnClick="btnVoltar_Click" />
     </div>
</asp:Content>
